<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2018/4/8
 * Time: 12:21
 */

class rcube_qrcode_db
{
    public function write($key, $vars)
    {
        $now = $this->db->now();
        $this->db->query("INSERT INTO {$this->table_name}"
            . " (`username`, `token`, `account_num`, `changed`)"
            . " VALUES (?, ?, ?, $now)",
            $key, base64_encode($vars), (string)$this->ip);
        return true;
    }
}